package com.ironman.h6b1gw.jxls.model;

import cn.hutool.core.util.RandomUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Department {

    private String name;

    private List<Employee> employees = new ArrayList<>();

    public static List<Department> departments() {
        List<Department> departmentList = new ArrayList<>();
        for (int i = 1; i < 4; i++) {
            Department department = new Department();
            department.setName("部门" + i);
            List<Employee> employees = department.getEmployees();
            for (int j = 1; j < 11; j++) {
                Employee employee = new Employee();
                employee.setName(department.getName() + ">员工" + j);
                employee.setAge(RandomUtil.randomInt(20, 39));
                employees.add(employee);
            }
            department.setEmployees(employees);
            departmentList.add(department);
        }
        return departmentList;

    }
}
